You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The aim of the PR is not to protect against an invalid input, but to handle correctly the null in JS.
JS interprets null as an object:
> typeof null
`object`
Therefore, the stringifyBigInts makes another recursion to call itself with null and the function breaks.
Hence, null needs to be handle differently.
I understand the stringifyBigInts as an utility to convert any object that contains bigInts into the same object, but the bigInts converted as strings, an object ready to be converted to a JSON file via JSON.stringify().
In the current approachm if that input object a null, the function breaks. While the JSON.stringify() works well with null
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nullobject instringifyBigIntsutils